﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


using Meqs.Entity;
using Meqs.Logic.Interface;
using Meqs.Entity.Views;

namespace Meqs.Logic.Implement
{
    public class ExamSubjecyEducationLogic : CommonLogic<ExamSubjecyEducation, int>, IExamSubjecyEducationLogic
    {
        /// <summary>
        /// 查询考试的所有科目
        /// </summary>
        /// <param name="ht"></param>
        /// <returns></returns>
        public IList<GlobalCauseInfo> FindExamSubject(Hashtable ht)
        {
            try
            {
                return FindCustomer<GlobalCauseInfo>("ExamSubjecyEducation.FindCause", ht); ;
            }
            catch (Exception ex)
            {
                //_log.Error("查询全部对象出错：" + ex.Message, ex);
                throw;
            }
        }
        /// <summary>
        /// 更具考试获取考试的科目
        /// </summary>
        /// <param name="examid"></param>
        /// <returns></returns>
        public IList<ExamSubjecyEducation2> GetExamCause(Hashtable ht)
        {
            try
            {
                return FindCustomer<ExamSubjecyEducation2>("ExamSubjecyEducation.FindExamCause2", ht); ;
            }
            catch (Exception ex)
            {
                //_log.Error("查询全部对象出错：" + ex.Message, ex);
                throw;
            }
        }
        /// <summary>
        /// 更具考试获取考试的科目
        /// </summary>
        /// <param name="examid"></param>
        /// <returns></returns>
        public IList<ExamSubjecyEducation2> GetExamCause(int examid, int classtype)
        {
            try
            {
                Hashtable ht = new Hashtable();
                ht.Add("examid", examid);
                ht.Add("classtype", classtype);
                return FindCustomer<ExamSubjecyEducation2>("ExamSubjecyEducation.FindExamCause", ht); ;
            }
            catch (Exception ex)
            {
                //_log.Error("查询全部对象出错：" + ex.Message, ex);
                throw;
            }
            //return null;
        }
        #region Implementation of ICommonLogic<ExamSubjecyEducation, int>

        /// <sammury>
        /// 创建对象
        /// </sammury>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Create(ExamSubjecyEducation entity)
        {
            return CreateObject(entity);
        }

        /// <sammury>
        /// 更新对象
        /// </sammury>
        /// <param name="entity"></param>
        /// <returns></returns>
        public int Update(ExamSubjecyEducation entity)
        {
            return UpdateObject(entity);
        }

        /// <summary>
        /// 删除对象
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public int Delete(int entityId)
        {
            return DeleteObject(entityId);
        }

        /// <summary>
        /// 删除所有对象
        /// </summary>
        /// <returns></returns>
        public int DeleteAll()
        {
            return DeleteAllObject();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="entityId"></param>
        /// <returns></returns>
        public ExamSubjecyEducation FindById(int entityId)
        {
            return FindObjectById(entityId);
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount()
        {
            return FindObjectByCount();
        }

        /// <sammury>
        /// 检索对象
        /// </sammury>
        public IList<ExamSubjecyEducation> FindAll()
        {
            return FindAllObject();
        }

        /// <summary>
        /// 检索对象数量
        /// </summary>
        /// <returns></returns>
        public int FindCount(Hashtable table)
        {
            return FindObjectByCount(table);
        }

        /// <sammury>
        /// 检索对象
        /// </sammury>
        public IList<ExamSubjecyEducation> FindAll(Hashtable table)
        {
            return FindObject(table);
        }

        #endregion
    }
}